package com.example.device.admin.web.controller;

import com.example.device.admin.common.constant.result.ResultStatus;
import com.example.device.admin.common.constant.result.BaseResp;
import com.example.device.admin.dao.entity.po.DeviceInfo;
import com.example.device.admin.service.DeviceInfoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.CrossOrigin;


@Controller
@CrossOrigin
public class DeviceDisplayController {

    @Autowired
    public DeviceInfoService deviceInfoService;

    //获取设备属性(设备在线状态)
    @RequestMapping(value = "/api/v1/device/queryDeviceProp",method = RequestMethod.GET)
    public @ResponseBody
    BaseResp<DeviceInfo> queryDeviceProp(String deviceName) {
        DeviceInfo deviceInfo=deviceInfoService.getDeviceInfoByDeviceName(deviceName);
        return new BaseResp<>(ResultStatus.SUCCESS,deviceInfo);
    }

}
